package com.time.sky.controller;

import com.time.sky.entity.JJBZ;
import com.time.sky.mapper.JJBZMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/JJBZ")
public class JJBZController {
    @Autowired
    private JJBZMapper jjbzMapper;
    @ResponseBody
    @RequestMapping("/selectGid1")
    public List<JJBZ> selectList1(){return jjbzMapper.selectGid1(); }
    @ResponseBody
    @RequestMapping("/selectGid2")
    public List<JJBZ> selectList2(){return jjbzMapper.selectGid2(); }
    @ResponseBody
    @RequestMapping("/selectGid3")
    public List<JJBZ> selectList3(){return jjbzMapper.selectGid3(); }
    @ResponseBody
    @RequestMapping("/selectGid4")
    public List<JJBZ> selectList4(){return jjbzMapper.selectGid4(); }
    @RequestMapping("/add")
    public void add(JJBZ jjbz){
        jjbzMapper.add(jjbz);
    }
    @RequestMapping("/delete/{jid}")
    public void delete(@PathVariable("jid") int jid){
        jjbzMapper.delete(jid);
    }
    @RequestMapping("/get/{jid}")
    public JJBZ getById(@PathVariable("jid") int jid){
        return jjbzMapper.getById(jid);
    }
    @RequestMapping("/update")
    public void update(JJBZ jjbz){
        jjbzMapper.update(jjbz);
    }
}
